Two of the Australians were alleged to have used a drone to take pictures of military sites, while a third was accused of spying for another country, spokesman Gholamhossein Esmaili told reporters.
It was the first official confirmation that Australians have been detained in Iran after the families of three of them said last week they had been arrested in the Islamic republic.
They identified them as a travel-blogging couple Jolie King and Mark Firkin and Melbourne University lecturer Kylie Moore-Gilbert.
"The news is correct," Esmaili said in a video posted on the state television website, adding the matter involved two separate cases.
"One case is of two people taking photos of military sites and our forbidden areas," the judiciary spokesman said.